﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MSHelpMeHD.Common
{
    using Windows.UI.Popups;

    static class MessageBox
    {
        static public async void ShowError(string content, string title)
        {
            ShowError(content, title, command => { });
        }

        static public async void ShowError(string content, string title, Action<IUICommand> f)
        {
            var messageDialog = new MessageDialog(content, title);

            messageDialog.Commands.Add(new UICommand(
                "Close",
                new UICommandInvokedHandler(f)));

            messageDialog.DefaultCommandIndex = 0;
            messageDialog.CancelCommandIndex = 0;
            await messageDialog.ShowAsync();
        }
    }
}
